<!DOCTYPE html>
<html lang="en">
<head>
    <title>Slide Navbar</title>
    <!-- 使用 url_for 引用静态 CSS 文件 -->
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/slide navbar style.css') }}">
    <link href="https://fonts.googleapis.com/css2?family=Jost:wght@500&display=swap" rel="stylesheet">
    <style>
        .error-message {
            color: red;
            text-align: center;
            margin-top: 10px;
        }
    </style>
</head>
<body>
    <div class="main">
        <input type="checkbox" id="chk" aria-hidden="true" checked> <!-- 默认选中登录 -->

        <div class="signup">
            <form method="POST" action="/signup">
                <label for="chk" aria-hidden="true">Sign up</label>
                <input type="text" name="name" placeholder="User name" required="">
                <input type="text" name="account" placeholder="Account" required="">
                <input type="password" name="pswd" placeholder="Password" required="">
                <button>Sign up</button>
                <!-- 显示注册成功的消息 -->
                {% if success %}
                    <p style="color:green; text-align:center;">{{ success }}</p>
                {% endif %}
            </form>
        </div>

        <div class="login">
            <form method="POST" action="/login">
                <label for="chk" aria-hidden="true">Login</label>
                <input type="text" name="account" placeholder="Account" required="">
                <input type="password" name="pswd" placeholder="Password" required="">
                <button>Login</button>
                <!-- 居中显示登录失败的错误信息 -->
                {% if error %}
                    <p class="error-message">{{ error }}</p>
                {% endif %}
            </form>
        </div>
    </div>
</body>
</html>
